﻿using System;

namespace NQueries
{
    /// <summary>
    /// Event args for the OnUnitOfWorkDisposed event.
    /// </summary>
    public class UnitOfWorkDisposedEventArgs : EventArgs
    {
        /// <summary>
        /// Constructor.
        /// </summary>
        /// <param name="name"></param>
        /// <param name="lifespan"></param>
        public UnitOfWorkDisposedEventArgs(string name, TimeSpan lifespan)
        {
            Name = name;
            Lifespan = lifespan;
        }

        /// <summary>
        /// Gets the total lifespan of this <see cref="IUnitOfWork"/>
        /// </summary>
        public TimeSpan Lifespan { get; private set; }

        /// <summary>
        /// The name of the <see cref="IUnitOfWork"/>.
        /// </summary>
        public string Name { get; private set; }
    }
}